package com.study.demo.aop.demo5;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * registerListeners
 *  	1. ApplicationListener
 * @author: elvin
 * @time: 2019-08-15 16:42
 * @desc:
 **/
@Component
public class MyApplicationListener implements ApplicationListener<ApplicationEvent> {
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        System.out.println("监听到事件: " + event);
    }

    /*@Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        System.out.println("监听到事件: " + event);
    }*/


}
